package com.bishi;

import java.util.Scanner;

/**
 * 找出数组中未出现的最小正整数
 */
public class 最右 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++){
            arr[i] = sc.nextInt();
        }
        System.out.println(findNum(arr, n));
    }

    public static int findNum(int[] arr, int n){
        int max = 0;
        int flag = 0;
        for(int i = 0; i< arr.length; i++){
            if(arr[i] > max){
                max = arr[i];
            }
        }
        int[] temp = new int[max+1];
        for(int i = 0; i < arr.length; i++){
            if(arr[i] > 0){
                temp[arr[i]]++;
            }
        }
        for(int i = 1; i < temp.length; i++){
            if(temp[i] == 0){
                return i;
            }
        }
        return max+1;
    }
}
